module.exports = app => {
    const seq = app.Sequelize;

    const Admin = app.model.define('admin', {
        id:{
            type:seq.INTEGER,
            autoIncrement:true,
            allowNull:false,
            primaryKey:true,
            unique:true
        },
        userName:{
            type:seq.STRING,
            allowNull:false
        },
        passWord: {
            type:seq.STRING,
            allowNull:false
        },
        email: {
            type:seq.STRING,
            allowNull:true,
        }
    },{
        timestamps:true,
        paranoid:true,
        underscored:false
    });

    Admin.associate=function () {
        app.model.Admin.hasMany(app.model.Wechat);
    };


    return Admin;
};